package edu.yctc.patterns.context;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import edu.yctc.patterns.dao.BlogDAO;

/**
 * @className InitialContext
 * @description 初始上下文
 * @author zyj
 * @date 2019年12月14日
 *
 */
@Service
public class InitialContext {

    @Resource
    private BlogDAO blogDAO;

    private static final String BLOGDAO = "BlogDAO";

    public Object lookup(String jndiName) {
        if (jndiName.equals(BLOGDAO)) {
            return this.blogDAO;
        } else {
            return null;
        }
    }

}
